// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation.  All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
// ------------------------------------------------------------

#pragma once

#include "stdafx.h"
#include "JsonSerializableTestBase.h"

namespace NativeAndManagedSerializationInteropTest
{    
    using namespace ServiceModel;

    /// Json properties of this class should match json properties of managed class defined in file:
    /// %SDXROOT%\services\winfab\prod\test\System.Fabric\unit\Common\Serialization\HealthSerializationInterop.Test.cs
    class HealthSerializationInteropTest : public JsonSerializableTestBase
    {
    public:
        HealthSerializationInteropTest()
        {
            // TODO: remove when 4586918 is fixed
            Common::CommonConfig::GetConfig().EnableApplicationTypeHealthEvaluation = true;
        }

        BEGIN_JSON_SERIALIZABLE_PROPERTIES()
            SERIALIZABLE_PROPERTY_ENUM(L"FABRIC_HEALTH_STATE_", FABRIC_HEALTH_STATE_)
            SERIALIZABLE_PROPERTY(L"FABRIC_HEALTH_EVENT_", FABRIC_HEALTH_EVENT_)

            SERIALIZABLE_PROPERTY(L"FABRIC_EVENT_HEALTH_EVALUATION_", FABRIC_EVENT_HEALTH_EVALUATION_)
            SERIALIZABLE_PROPERTY(L"FABRIC_HEALTH_EVALUATION_", FABRIC_HEALTH_EVALUATION_)
            SERIALIZABLE_PROPERTY(L"FABRIC_REPLICA_HEALTH_EVALUATION_", FABRIC_REPLICA_HEALTH_EVALUATION_)
            SERIALIZABLE_PROPERTY(L"FABRIC_REPLICAS_HEALTH_EVALUATION_", FABRIC_REPLICAS_HEALTH_EVALUATION_)
            SERIALIZABLE_PROPERTY(L"FABRIC_PARTITION_HEALTH_EVALUATION_", FABRIC_PARTITION_HEALTH_EVALUATION_)
            SERIALIZABLE_PROPERTY(L"FABRIC_PARTITIONS_HEALTH_EVALUATION_", FABRIC_PARTITIONS_HEALTH_EVALUATION_)
            SERIALIZABLE_PROPERTY(L"FABRIC_SERVICE_HEALTH_EVALUATION_", FABRIC_SERVICE_HEALTH_EVALUATION_)
            SERIALIZABLE_PROPERTY(L"FABRIC_SERVICES_HEALTH_EVALUATION_", FABRIC_SERVICES_HEALTH_EVALUATION_)
            SERIALIZABLE_PROPERTY(L"FABRIC_APPLICATION_HEALTH_EVALUATION_", FABRIC_APPLICATION_HEALTH_EVALUATION_)
            SERIALIZABLE_PROPERTY(L"FABRIC_APPLICATIONS_HEALTH_EVALUATION_", FABRIC_APPLICATIONS_HEALTH_EVALUATION_)
            SERIALIZABLE_PROPERTY(L"FABRIC_APPLICATION_TYPE_APPLICATIONS_HEALTH_EVALUATION_", FABRIC_APPLICATION_TYPE_APPLICATIONS_HEALTH_EVALUATION_)
            SERIALIZABLE_PROPERTY(L"FABRIC_SYSTEM_APPLICATION_HEALTH_EVALUATION_", FABRIC_SYSTEM_APPLICATION_HEALTH_EVALUATION_)
            SERIALIZABLE_PROPERTY(L"FABRIC_NODE_HEALTH_EVALUATION_", FABRIC_NODE_HEALTH_EVALUATION_)
            SERIALIZABLE_PROPERTY(L"FABRIC_NODES_HEALTH_EVALUATION_", FABRIC_NODES_HEALTH_EVALUATION_)
            SERIALIZABLE_PROPERTY(L"FABRIC_UPGRADE_DOMAIN_NODES_HEALTH_EVALUATION_", FABRIC_UPGRADE_DOMAIN_NODES_HEALTH_EVALUATION_)

            SERIALIZABLE_PROPERTY(L"FABRIC_DEPLOYED_SERVICE_PACKAGE_HEALTH_EVALUATION_", FABRIC_DEPLOYED_SERVICE_PACKAGE_HEALTH_EVALUATION_)
            SERIALIZABLE_PROPERTY(L"FABRIC_DEPLOYED_SERVICE_PACKAGES_HEALTH_EVALUATION_", FABRIC_DEPLOYED_SERVICE_PACKAGES_HEALTH_EVALUATION_)
            SERIALIZABLE_PROPERTY(L"FABRIC_DEPLOYED_APPLICATION_HEALTH_EVALUATION_", FABRIC_DEPLOYED_APPLICATION_HEALTH_EVALUATION_)
            SERIALIZABLE_PROPERTY(L"FABRIC_DEPLOYED_APPLICATIONS_HEALTH_EVALUATION_", FABRIC_DEPLOYED_APPLICATIONS_HEALTH_EVALUATION_)
            SERIALIZABLE_PROPERTY(L"FABRIC_UPGRADE_DOMAIN_DEPLOYED_APPLICATIONS_HEALTH_EVALUATION_", FABRIC_UPGRADE_DOMAIN_DEPLOYED_APPLICATIONS_HEALTH_EVALUATION_)
            SERIALIZABLE_PROPERTY(L"FABRIC_DELTA_NODES_CHECK_HEALTH_EVALUATION_", FABRIC_DELTA_NODES_CHECK_HEALTH_EVALUATION_)
            SERIALIZABLE_PROPERTY(L"FABRIC_UPGRADE_DOMAIN_DELTA_NODES_CHECK_HEALTH_EVALUATION_", FABRIC_UPGRADE_DOMAIN_DELTA_NODES_CHECK_HEALTH_EVALUATION_)

            SERIALIZABLE_PROPERTY(L"FABRIC_REPLICA_HEALTH_", FABRIC_REPLICA_HEALTH_)
            SERIALIZABLE_PROPERTY(L"FABRIC_PARTITION_HEALTH_", FABRIC_PARTITION_HEALTH_)
            SERIALIZABLE_PROPERTY(L"FABRIC_SERVICE_HEALTH_", FABRIC_SERVICE_HEALTH_)
            SERIALIZABLE_PROPERTY(L"FABRIC_DEPLOYED_SERVICE_PACKAGE_HEALTH_", FABRIC_DEPLOYED_SERVICE_PACKAGE_HEALTH_)
            SERIALIZABLE_PROPERTY(L"FABRIC_APPLICATION_HEALTH_", FABRIC_APPLICATION_HEALTH_)
            SERIALIZABLE_PROPERTY(L"FABRIC_NODE_HEALTH_", FABRIC_NODE_HEALTH_)
            SERIALIZABLE_PROPERTY(L"FABRIC_CLUSTER_HEALTH_", FABRIC_CLUSTER_HEALTH_)
            SERIALIZABLE_PROPERTY(L"FABRIC_DEPLOYED_APPLICATION_HEALTH_", FABRIC_DEPLOYED_APPLICATION_HEALTH_)
            SERIALIZABLE_PROPERTY(L"FABRIC_CLUSTER_HEALTH_POLICY_", FABRIC_CLUSTER_HEALTH_POLICY_)
            SERIALIZABLE_PROPERTY(L"FABRIC_CLUSTER_HEALTH_POLICY_NO_APP_TYPE_", FABRIC_CLUSTER_HEALTH_POLICY_NO_APP_TYPE_)
            SERIALIZABLE_PROPERTY(L"FABRIC_APPLICATION_HEALTH_POLICY_", FABRIC_APPLICATION_HEALTH_POLICY_)

            SERIALIZABLE_PROPERTY(L"FABRIC_REPLICA_HEALTH_STATE_CHUNK_", FABRIC_REPLICA_HEALTH_STATE_CHUNK_)
            SERIALIZABLE_PROPERTY(L"FABRIC_PARTITION_HEALTH_STATE_CHUNK_", FABRIC_PARTITION_HEALTH_STATE_CHUNK_)
            SERIALIZABLE_PROPERTY(L"FABRIC_SERVICE_HEALTH_STATE_CHUNK_", FABRIC_SERVICE_HEALTH_STATE_CHUNK_)
            SERIALIZABLE_PROPERTY(L"FABRIC_DEPLOYED_SERVICE_PACKAGE_HEALTH_STATE_CHUNK_", FABRIC_DEPLOYED_SERVICE_PACKAGE_HEALTH_STATE_CHUNK_)
            SERIALIZABLE_PROPERTY(L"FABRIC_DEPLOYED_APPLICATION_HEALTH_STATE_CHUNK_", FABRIC_DEPLOYED_APPLICATION_HEALTH_STATE_CHUNK_)
            SERIALIZABLE_PROPERTY(L"FABRIC_APPLICATION_HEALTH_STATE_CHUNK_", FABRIC_APPLICATION_HEALTH_STATE_CHUNK_)
            SERIALIZABLE_PROPERTY(L"FABRIC_NODE_HEALTH_STATE_CHUNK_", FABRIC_NODE_HEALTH_STATE_CHUNK_)
            SERIALIZABLE_PROPERTY(L"FABRIC_CLUSTER_HEALTH_CHUNK_", FABRIC_CLUSTER_HEALTH_CHUNK_)

            SERIALIZABLE_PROPERTY(L"FABRIC_REPLICA_HEALTH_STATE_FILTER_", FABRIC_REPLICA_HEALTH_STATE_FILTER_)
            SERIALIZABLE_PROPERTY(L"FABRIC_PARTITION_HEALTH_STATE_FILTER_", FABRIC_PARTITION_HEALTH_STATE_FILTER_)
            SERIALIZABLE_PROPERTY(L"FABRIC_SERVICE_HEALTH_STATE_FILTER_", FABRIC_SERVICE_HEALTH_STATE_FILTER_)
            SERIALIZABLE_PROPERTY(L"FABRIC_DEPLOYED_SERVICE_PACKAGE_HEALTH_STATE_FILTER_", FABRIC_DEPLOYED_SERVICE_PACKAGE_HEALTH_STATE_FILTER_)
            SERIALIZABLE_PROPERTY(L"FABRIC_DEPLOYED_APPLICATION_HEALTH_STATE_FILTER_", FABRIC_DEPLOYED_APPLICATION_HEALTH_STATE_FILTER_)
            SERIALIZABLE_PROPERTY(L"FABRIC_NODE_HEALTH_STATE_FILTER_", FABRIC_NODE_HEALTH_STATE_FILTER_)
            SERIALIZABLE_PROPERTY(L"FABRIC_APPLICATION_HEALTH_STATE_FILTER_", FABRIC_APPLICATION_HEALTH_STATE_FILTER_)

            SERIALIZABLE_PROPERTY(L"FABRIC_CLUSTER_HEALTH_CHUNK_QUERY_DESCRIPTION_", FABRIC_CLUSTER_HEALTH_CHUNK_QUERY_DESCRIPTION_)
        END_JSON_SERIALIZABLE_PROPERTIES()

        // Core types
        FABRIC_HEALTH_STATE FABRIC_HEALTH_STATE_;
        ServiceModel::HealthEvent FABRIC_HEALTH_EVENT_;
        ServiceModel::HealthEvaluation FABRIC_HEALTH_EVALUATION_;

        // Entity Health
        ServiceModel::ReplicaHealth FABRIC_REPLICA_HEALTH_;
        ServiceModel::PartitionHealth FABRIC_PARTITION_HEALTH_;
        ServiceModel::ServiceHealth FABRIC_SERVICE_HEALTH_;
        ServiceModel::ApplicationHealth FABRIC_APPLICATION_HEALTH_;
        ServiceModel::NodeHealth FABRIC_NODE_HEALTH_;
        ServiceModel::ClusterHealth FABRIC_CLUSTER_HEALTH_;
        ServiceModel::DeployedApplicationHealth FABRIC_DEPLOYED_APPLICATION_HEALTH_;
        ServiceModel::DeployedServicePackageHealth FABRIC_DEPLOYED_SERVICE_PACKAGE_HEALTH_;

        // HealthEvaluation and expected types
        ServiceModel::HealthEvaluation FABRIC_EVENT_HEALTH_EVALUATION_;

        ServiceModel::HealthEvaluation FABRIC_REPLICA_HEALTH_EVALUATION_;
        ServiceModel::HealthEvaluation FABRIC_REPLICAS_HEALTH_EVALUATION_;

        ServiceModel::HealthEvaluation FABRIC_PARTITION_HEALTH_EVALUATION_;
        ServiceModel::HealthEvaluation FABRIC_PARTITIONS_HEALTH_EVALUATION_;

        ServiceModel::HealthEvaluation FABRIC_SERVICE_HEALTH_EVALUATION_;
        ServiceModel::HealthEvaluation FABRIC_SERVICES_HEALTH_EVALUATION_;

        ServiceModel::HealthEvaluation FABRIC_APPLICATION_HEALTH_EVALUATION_;
        ServiceModel::HealthEvaluation FABRIC_APPLICATIONS_HEALTH_EVALUATION_;
        ServiceModel::HealthEvaluation FABRIC_APPLICATION_TYPE_APPLICATIONS_HEALTH_EVALUATION_;
        ServiceModel::HealthEvaluation FABRIC_DEPLOYED_APPLICATION_HEALTH_EVALUATION_;
        ServiceModel::HealthEvaluation FABRIC_DEPLOYED_APPLICATIONS_HEALTH_EVALUATION_;
        ServiceModel::HealthEvaluation FABRIC_UPGRADE_DOMAIN_DEPLOYED_APPLICATIONS_HEALTH_EVALUATION_;
        ServiceModel::HealthEvaluation FABRIC_SYSTEM_APPLICATION_HEALTH_EVALUATION_;

        ServiceModel::HealthEvaluation FABRIC_DEPLOYED_SERVICE_PACKAGE_HEALTH_EVALUATION_;
        ServiceModel::HealthEvaluation FABRIC_DEPLOYED_SERVICE_PACKAGES_HEALTH_EVALUATION_;

        ServiceModel::HealthEvaluation FABRIC_NODE_HEALTH_EVALUATION_;
        ServiceModel::HealthEvaluation FABRIC_NODES_HEALTH_EVALUATION_;
        ServiceModel::HealthEvaluation FABRIC_UPGRADE_DOMAIN_NODES_HEALTH_EVALUATION_;
        ServiceModel::HealthEvaluation FABRIC_DELTA_NODES_CHECK_HEALTH_EVALUATION_;
        ServiceModel::HealthEvaluation FABRIC_UPGRADE_DOMAIN_DELTA_NODES_CHECK_HEALTH_EVALUATION_;

        ServiceModel::ClusterHealthPolicy FABRIC_CLUSTER_HEALTH_POLICY_;
        ServiceModel::ClusterHealthPolicy FABRIC_CLUSTER_HEALTH_POLICY_NO_APP_TYPE_;
        ServiceModel::ApplicationHealthPolicy FABRIC_APPLICATION_HEALTH_POLICY_;

        ServiceModel::ReplicaHealthStateChunk FABRIC_REPLICA_HEALTH_STATE_CHUNK_;
        ServiceModel::PartitionHealthStateChunk FABRIC_PARTITION_HEALTH_STATE_CHUNK_;
        ServiceModel::ServiceHealthStateChunk FABRIC_SERVICE_HEALTH_STATE_CHUNK_;
        ServiceModel::DeployedServicePackageHealthStateChunk FABRIC_DEPLOYED_SERVICE_PACKAGE_HEALTH_STATE_CHUNK_;
        ServiceModel::DeployedApplicationHealthStateChunk FABRIC_DEPLOYED_APPLICATION_HEALTH_STATE_CHUNK_;
        ServiceModel::ApplicationHealthStateChunk FABRIC_APPLICATION_HEALTH_STATE_CHUNK_;
        ServiceModel::NodeHealthStateChunk FABRIC_NODE_HEALTH_STATE_CHUNK_;
        ServiceModel::ClusterHealthChunk FABRIC_CLUSTER_HEALTH_CHUNK_;
        ServiceModel::ReplicaHealthStateFilter FABRIC_REPLICA_HEALTH_STATE_FILTER_;
        ServiceModel::PartitionHealthStateFilter FABRIC_PARTITION_HEALTH_STATE_FILTER_;
        ServiceModel::ServiceHealthStateFilter FABRIC_SERVICE_HEALTH_STATE_FILTER_;
        ServiceModel::DeployedServicePackageHealthStateFilter FABRIC_DEPLOYED_SERVICE_PACKAGE_HEALTH_STATE_FILTER_;
        ServiceModel::DeployedApplicationHealthStateFilter FABRIC_DEPLOYED_APPLICATION_HEALTH_STATE_FILTER_;
        ServiceModel::NodeHealthStateFilter FABRIC_NODE_HEALTH_STATE_FILTER_;
        ServiceModel::ApplicationHealthStateFilter FABRIC_APPLICATION_HEALTH_STATE_FILTER_;
        ServiceModel::ClusterHealthChunkQueryDescription FABRIC_CLUSTER_HEALTH_CHUNK_QUERY_DESCRIPTION_;
    };
}
